package com.easybuy.util;

import java.util.List;

import com.easybuy.entity.Product;

/**
 * 分页工具类
 * @author Dylan
 *
 */
public class PageUtil<T> {
	
	private int currPage=1;
	
	private int pageSize=4;
	
	private int totalCount;
	
	private int totalPage;
	
	private List<T> list;

	public int getCurrPage() {
		return currPage;
	}

	public void setCurrPage(int currPage) {
		this.currPage = currPage;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
		
		this.totalPage = totalCount/pageSize;
		
		if (totalCount%pageSize != 0) {
			totalPage++;
		}
	}

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
		
		this.totalPage = totalCount/pageSize;
		
		if (totalCount%pageSize != 0) {
			totalPage++;
		}
	}

	public int getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public List<T> getList() {
		return list;
	}

	public void setList(List<T> list) {
		this.list = list;
	}
	
}
